import { axios, get, post, Delete, Patch } from './request'

// 封装所有的接口API
// 反向代理 

export const ajax = {
  getword: () => get('/word'),

  findUser: (params) => get('/users', params),

  addUser: (data) => post('/users', data),

  // 修改密码
  updatePassword: (id, data) => Patch('/users/'+id, data),

  // 发送验证码 网易云接口 一天5次免费
  sendCaptcha: (params) => get('http://47.104.209.44:3333/captcha/sent', params),

  // 校验验证码
  verifyCaptcha: (params) => get('http://47.104.209.44:3333/captcha/verify', params),

  // 卖座get接口
  getMaiData: (params, headers) => get('https://m.maizuo.com/gateway', params, headers),

  // 卖座post接口
  postMaiData: (data, headers) => post("https://m.maizuo.com/gateway", data, {}, headers),

  // 商品列表
  getGoodList: (params) => get('http://localhost:3000/goods', params),

  // 点赞
  getLikeOne: (params) => get('http://localhost:3000/glikes', params),

  // 添加
  addLikeOne: (params) => post('http://localhost:3000/glikes', params),

  // 删除
  removeLikeOne: (id) => Delete('http://localhost:3000/glikes/'+id)

}